﻿@model DotNetUniLodz.Models.Event

@{
    ViewBag.Title = "Edytuj wydarzenie " + Model.Event_name;
}

<div id="Content100">
    <h2>Wydarzenia</h2>

    @using (Html.BeginForm())
    {
        @Html.AntiForgeryToken()
        @Html.ValidationSummary(true)

        <fieldset id="CreateItem">
            <legend>Edytuj wydarzenie</legend>

            @Html.HiddenFor(model => model.Event_id)
            @Html.HiddenFor(model => model.User_author)

            <div class="editor-label">
                Nazwa
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.Event_name)
                @Html.ValidationMessageFor(model => model.Event_name)
            </div>

            <div class="editor-label">
                Link do strony wydarzenia/rejestracji
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.Event_link)
                @Html.ValidationMessageFor(model => model.Event_link)
            </div>

            <div class="editor-label">
                Data
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(model => model.Event_date, new { id = "eventDate" })
                @Html.ValidationMessageFor(model => model.Event_date)
                <script>
                    $('#eventDate').datepicker();
                </script>
            </div>

            <div class="editor-label">
                Godzina
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.Event_time)
                @Html.ValidationMessageFor(model => model.Event_time)
            </div>

            <div class="editor-label">
                Miejsce
            </div>
            <div class="editor-field">
                @Html.EditorFor(model => model.Event_where)
                @Html.ValidationMessageFor(model => model.Event_where)
            </div>

            <div class="editor-label">
                Opis
            </div>
            <div class="editor-field">
                @Html.Partial("EditorTemplates/tinymce_jquery_full", new DotNetUniLodz.Models.TextModel() { PropertyName = "Event_description", Value = Model == null ? string.Empty : Model.Event_description })
                @Html.ValidationMessageFor(model => model.Event_description)
            </div>

            <p>
                <input type="submit" value="Zapisz" />
            </p>
        </fieldset>
    }
    <div>
        @Html.ActionLink("Powrót do listy wydarzeń", "Index", null, new { @class = "SuperLink" })
    </div>
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
